| Conditions | 1 |
| Paths | 2 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | export function throttle(callback, scope, limit = 100, options = {}) { |
||
| 2 | |||
| 3 | options = { |
||
| 4 | leading: true, |
||
| 5 | trailing: false, |
||
| 6 | ...options |
||
| 7 | }; |
||
| 8 | |||
| 9 | let wait = false; |
||
| 10 | let skip = false; |
||
| 11 | |||
| 12 | if (options.leading === false) { |
||
| 13 | skip = true; |
||
| 14 | } |
||
| 15 | |||
| 16 | const later = debounce(function dodebounce() { |
||
| 75 |